<template>
    <div class="jindu  animate__animated animate__fadeInDown">
        <el-steps :active="activeIndex">
          <el-step @click.native="maodian(index + 1)" v-for="(item, index) in list" :key="index" :title="item.name">
            <div slot="icon">
              <div class="icon"></div>
            </div>
          </el-step>
        </el-steps>
    </div>
</template>
<script>
export default {
    props:['list'],
  data() {
    return {
        activeIndex:1
    }
  },
  methods:{
    maodian(num) {
      console.log(num)
      this.activeIndex = num
      this.$emit('handletab',num)
      this.list.map((item, i) => {
        if (i <= (num - 1)) {
          item.active = true
        } else {
          item.active = false
        }
      })
    }
  }
}
</script>